import 'package:flutter/material.dart';
import 'package:flutter_rider/main/widgets/ext/u_text.dart';
import 'package:flutter_rider/main/widgets/ui_constant.dart';
import 'package:flutter_rider/utils/screen_fit.dart';
import 'package:url_launcher/url_launcher.dart';

class DetailFlexStartUndelineLayout extends StatelessWidget {
  String title;
  String value;
  double ? pixel;
  DetailFlexStartUndelineLayout(this.title, this.value, { this.pixel, Key? key}): super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
      16.wspace,
      SizedBox(
          width: 80.rpx, child: UText.get(title, UIColor.color_t7, pixel ?? 16.rpx)),
      GestureDetector(
        onTap: () {
          launch("tel:$value");
        },
        child: Text(
          value.toString(),
          style: TextStyle(
            fontSize: pixel ?? 16.rpx,
            color: UIColor.color_primary,
            decoration: TextDecoration.underline,
            decorationColor: UIColor.color_primary,
          ),
        ),
      ),
      16.wspace,
    ]);
  }
}
